﻿<Window x:Class="WadViewer.WinApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Windows Azure Diagnostics Viewer" Height="600" Width="1000">
	<Grid Background="Azure">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="1*" />
			<RowDefinition Height="Auto" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<GroupBox BorderBrush="Black" BorderThickness="1" Margin="4" Header="Selection">
			<StackPanel Orientation="Horizontal">
				<TextBlock VerticalAlignment="Center" Margin="4">Connection:</TextBlock>
				<ComboBox x:Name="cbConnections" Margin="4" Grid.Column="1" Width="150" />
				<TextBlock VerticalAlignment="Center" Margin="4">Type:</TextBlock>
				<ComboBox x:Name="cbTable" Margin="4" Grid.Column="1" Width="150">
					<ComboBox.Items>
						<ComboBoxItem Content="Trace Logs" />
						<ComboBoxItem Content="Event Logs" />
						<ComboBoxItem Content="Performance Counters" />
					</ComboBox.Items>
				</ComboBox>
				<TextBlock VerticalAlignment="Center" Grid.Row="1" Margin="4">From:</TextBlock>
				<DatePicker Grid.Row="1" Grid.Column="1" x:Name="dpFrom" Width="120" Margin="4"/>
				<TextBlock VerticalAlignment="Center" Grid.Row="1" Grid.Column="2" Margin="4">To:</TextBlock>
				<DatePicker Grid.Row="1" Grid.Column="3" x:Name="dpTo" Width="120" Margin="4" />
			</StackPanel>
		</GroupBox>
		<GroupBox Grid.Row="1" Margin="4" Padding="4" BorderBrush="Black" BorderThickness="1" Header="Logs" >
			<DataGrid x:Name="icEntities" AutoGenerateColumns="False" SelectionMode="Single">
				<DataGrid.Columns>
					<DataGridTextColumn Binding="{Binding Timestamp, Mode=OneWay}" Width="Auto" Header="Timestamp"/>
					<DataGridTextColumn Binding="{Binding Role, Mode=OneWay}" Width="Auto" Header="Role"/>
					<DataGridTextColumn Binding="{Binding ListDisplay, Mode=OneWay}" Width="Auto" Header="Log" />
				</DataGrid.Columns>
			</DataGrid>
		</GroupBox>
		<GroupBox Grid.Row="2" Margin="4" Padding="4" BorderBrush="Black" BorderThickness="1" Header="Selected Log">
			<ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled">
				<ContentControl Content="{Binding ElementName=icEntities, Path=SelectedItem}" ContentTemplateSelector="{StaticResource TemplateSelector}" Background="White" />
			</ScrollViewer>
		</GroupBox>
		<StatusBar Grid.Row="3" Background="Azure">
			<StatusBarItem x:Name="tbStatus" Width="250" Content="Select connection and type" />
			<StatusBarItem x:Name="tbCount" HorizontalAlignment="Center" Content="0"/>
			<StatusBarItem x:Name="tbTimestamp" HorizontalAlignment="Right" Content="Nothing retrieved"/>
		</StatusBar>
	</Grid>
</Window>
